#include "SList.h"

void SLTTest1()
{
	SLTNode* node1 = (SLTNode*)malloc(sizeof(SLTNode));
	node1->data = 1;

	SLTNode* node2 = (SLTNode*)malloc(sizeof(SLTNode));
	node2->data = 2;

	SLTNode* node3 = (SLTNode*)malloc(sizeof(SLTNode));
	node3->data = 3;

	SLTNode* node4 = (SLTNode*)malloc(sizeof(SLTNode));
	node4->data = 4;

	node1->next = node2;
	node2->next = node3;
	node3->next = node4;
	node4->next = NULL;

	SLTNode* plist = node1;
	SLTPrint(plist);
}

void SLTTest2()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist,1);
	SLTPushBack(&plist,2);
	SLTPushFront(&plist,3);
	SLTPushFront(&plist,4);
	SLTPrint(plist);
	SLTInsert(&plist,SLTFind(plist,4),11);
	SLTPrint(plist);
	SLTInsertAfter(SLTFind(plist,4),110);
	SLTPrint(plist);
	SLTNode* find = SLTFind(plist, 11);
	SLTEraseAfter(find);
	SLTPrint(plist);
	SLTDestroy(&plist);
	SLTPrint(plist);
}

int main()
{
	//SLTTest1();
	SLTTest2();

	return 0;
}